import qs from 'qs';
import { RequestServerClass } from '@/util/request';

export class YjwzService {

    public rSerivce: any;

    constructor(opt: any, axiosFilterFn?: any) {
        this.rSerivce = new RequestServerClass(opt);
    }



    public getDemoData() {
        return new Promise((resolve, reject) => {
            const list: any = [];
            for (let i = 0; i < 10; i++) {
                list.push({
                    id: `id${i}`,
                    longitude: 116 + Math.random(),
                    latitude: 39 + Math.random(),
                });
            }
            resolve(list);
        });
    }
    // 获取应急物资汇总列表和应急物资需求汇总列表
    public getMaterialList(opts?: any) {
        const url = '/material/getMaterialList';
        return this.rSerivce.serverObj.post(url + '?' + qs.stringify(opts));
    }

    // 获取应急物资类型接口
    public getMaterialType() {
        const url = '/materialtype/getMaterialType';
        return this.rSerivce.serverObj.post(url);
    }
}
